<template>
  <div class="container">
    <div class="form">
      <el-form
        ref="selectForm"
        :model="selectForm"
        :rules="$rules"
        status-icon
        label-width="200px"
      >
        <el-form-item prop="Companytype" :label="$language.local('企业类型')">
          <!-- <merchant-type v-model="selectForm.Companytype"></merchant-type> -->
          <el-radio-group v-model="selectForm.Companytype">
            <el-radio label="0">企业</el-radio>
            <el-radio label="1">个体工商户</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item prop="invoiceType" :label="$language.local('开票类型')">
          <el-radio-group v-model="selectForm.invoiceType">
            <el-radio label="0">全额发票</el-radio>
            <el-radio label="1">差额发票</el-radio>
            <el-radio label="2">其它发票</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item
          prop="empSignType"
          :label="$language.local('自由职业者签约类型')"
        >
          <el-radio-group v-model="selectForm.empSignType">
            <el-radio label="0">先签约,后付款(电子协议)</el-radio>
            <el-radio label="1">批量签约(纸质协议)</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item
          prop="customNature"
          :label="$language.local('纳税人性质')"
        >
          <el-radio-group v-model="selectForm.customNature">
            <el-radio label="0">一般纳税人</el-radio>
            <el-radio label="1">小规模纳税人</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item prop="payType" :label="$language.local('付款方式')">
          <el-radio-group v-model="selectForm.payType">
            <el-radio label="0">银行卡</el-radio>
            <el-radio label="1">钱包账户</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item
          prop="IsSendMessageToEmp"
          :label="$language.local('是否下发短信')"
        >
          <el-radio-group v-model="selectForm.IsSendMessageToEmp">
            <!-- <el-radio label="0">发送短信</el-radio>
            <el-radio label="1">不发送短信</el-radio> -->
            <el-switch v-model="selectForm.IsSendMessageToEmp"></el-switch>
          </el-radio-group>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="onSubmit">{{
          $language.local("下一步")
        }}</el-button>
      </span>
    </div>
    <!-- <div class="right"></div> -->
  </div>
</template>

<script>
export default {
  data() {
    return {
      selectForm: {
        Companytype: "0",
        invoiceType: "0",
        empSignType: "0",
        customNature: "0",
        payType: "0",
        IsSendMessageToEmp: "0",
      },
    };
  },
  created() {
    console.log(this.$route.params);
    if (this.$route.params.customCollectorPhone) {
      this.selectForm = { ...this.$route.params, ...this.selectForm };
    } else {
      this.$router.push("register-phone");
    }
  },
  methods: {
    onSubmit() {
      console.log(this);
      this.$refs["selectForm"].validate((valided) => {
        if (!valided) {
          return;
        }
        console.log(this.selectForm);
        this.$router.push("business-info");
      });
    },
  },
};
</script>

<style lang="less" scoped>
.container {
  display: flex;
  width: 100%;
  justify-content: center;
  .form {
    // flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    padding: 0 5rem;
    margin: 5rem 0;

    .el-form {
      width: 100%;
    }
    //border-right: 1px solid #aaa;
  }
  .right {
    flex: 1;
  }
}
</style>
